<?php
/* @var $this FileController */
/* @var $model File */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'file-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
    'htmlOptions'=>array('enctype'=>'multipart/form-data'),
)); ?>

	<p class="note">带 <span class="required">*</span> 的项目必填.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'file_type'); ?>
		<?php //echo $form->textField($model,'file_type'); ?>
		<?php echo $form->dropDownList($model,'file_type',FileType::model()->getListArray()); ?>
		<?php echo $form->error($model,'file_type'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'file_path'); ?>
		<?php //echo $form->textField($model,'file_path',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo CHtml::activeFileField($model,'file_path',array('size'=>60,'maxlength'=>255)); ?>  
		<?php echo $form->error($model,'file_path'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'file_name'); ?>
		<?php echo $form->textField($model,'file_name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'file_name'); ?>
	</div>

	<!--
	<div class="row">
		<?php echo $form->labelEx($model,'file_addtime'); ?>
		<?php echo $form->textField($model,'file_addtime',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'file_addtime'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'file_size'); ?>
		<?php echo $form->textField($model,'file_size',array('size'=>32,'maxlength'=>32)); ?>
		<?php echo $form->error($model,'file_size'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'file_info'); ?>
		<?php echo $form->textField($model,'file_info',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'file_info'); ?>
	</div>
    -->
      
	<div class="row">
		<?php echo $form->labelEx($model,'file_desc'); ?>
		<?php echo $form->textArea($model,'file_desc',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'file_desc'); ?>
	</div>

	<!--
	<div class="row">
		<?php echo $form->labelEx($model,'download_times'); ?>
		<?php echo $form->textField($model,'download_times'); ?>
		<?php echo $form->error($model,'download_times'); ?>
	</div>
	-->

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '上传' : '保存'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->